import { Body, Controller, Post } from '@nestjs/common';
import { OrderService } from './order.service';
import { CreateOrderDto } from './dto/create-order.dto';

@Controller('order')
export class OrderController {
  /**
   * 订单控制器构造函数
   * @param orderService - 订单服务
   */
  constructor(private readonly orderService: OrderService) {}

  /**
   * 创建新订单
   * @param createOrderDto - 创建订单数据
   * @returns 创建的订单信息
   */
  @Post()
  async createOrder(@Body() createOrderDto: CreateOrderDto) {
    return this.orderService.createOrder(createOrderDto);
  }
}
